package com.wuxiaofan.service;

import com.wuxiaofan.api.request.ScheduleRequest;
import com.wuxiaofan.entity.model.ScheduleMongo;
import com.wuxiaofan.repository.ScheduleRepository;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @author wuxiaofan
 * @date 2021/11/2 9:11 上午
 */
@Service
public class ScheduleService {

    @Resource
    private ScheduleRepository scheduleRepository;


    public void save(ScheduleMongo scheduleMongo){
        scheduleRepository.save(scheduleMongo);
    }


    public List<ScheduleMongo> all(ScheduleRequest scheduleRequest){
        return scheduleRepository.findByHoscode(scheduleRequest.getHoscode());
    }


    public void deleteById(String id){
        scheduleRepository.deleteById(id);
    }
}
